home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93a.txt
/
000110_icon-group-sender _Fri Apr 2 10:02:24 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-04-21
|
2KB
Received: by cheltenham.cs.arizona.edu; Sat, 10 Apr 1993 05:36:01 MST
Date: 2 Apr 93 10:02:24 GMT
From: mcsun!news.funet.fi!uta!jere@uunet.uu.net (Jere K{pyaho)
Organization: University of Tampere, Finland
Subject: Icon rookie problems solved
Message-Id: <9364@kielo.uta.fi>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
Thanks to those people who took the time to help me with my
(admittedly trivial) problem concerning Exercise 3.1 of
"The Icon Programming Language" (2nd Ed.). I am just learning
Icon, and I was very happy to get prompt and friendly
answers.
The problem was to write a procedure which generates all
the characters of a string that are found in a given cset,
from left to right. That is, given the string "input and
output" and the cset 'ut', the procedure should generate
"u", "t", "u", "t", "u", and "t".
For the record, here is my solution:
#-------cut here------------------
procedure main( L )
genchar( L[1], L[2] ) # don't know how to validate these yet :-)
end
procedure genchar( s, c )
s ? {
every i := upto( c ) do {
tab( i )
write( move( i ) )
}
}
end
#--------cut here-----------------
Although I'm fascinated by Icon, I don't find this example
too intuitive. Maybe it could be further reduced?
As to my second problem, it turned out to be an RTFM error.
The document IPD205.DOC clearly states that you can't build
the Icon version 8.8 compiler under MS-DOS without a 32-bit
compiler and a DOS extender, neither of which I own. Oh well.
--
// Jere K{pyaho (jere@kielo.uta.fi) | Work is the curse of the
// University of Tampere, Finland | drinking classes. -Oscar Wilde